<ion-view view-title="销售统计" hide-back-button="true" show-tabs="true">
      <ion-nav-buttons side="right">
        <button ng-controller="filterController" class="button button-icon icon-left ion-ios-calendar-outline"  ng-click="showDateFilter()">
        </button>
        <button class="button button-icon ion-navicon rotate90" menu-toggle="right">
        </button>
      </ion-nav-buttons>

  <ion-content class="has-tabs">

    <section class="light royal-bg text-center now-sell">
      <div class="bar bar-royal block-title">
        <h5 class="light">
          <span ng-if="saleAnalytics.loaded">今日实时销售</span>
          <ion-spinner icon="lines" ng-if="!saleAnalytics.loaded" class="spinner-light"></ion-spinner>
        </h5>

      </div>
      <div>
        <h1 class="light" ng-show="saleAnalytics.loaded">{{saleAnalytics.totalSale | currency:'￥' | numFormat:true}} <small>/ {{saleAnalytics.orderCount}} 单</small></h1>
        <div class="attenuated">销售额</div>
      </div>

      <div class="row">
        <div class="col">
          <h3 class="light" ng-show="saleAnalytics.loaded">{{saleAnalytics.totalMargin | currency:'￥' | numFormat:true}} </h3>
          <div class="attenuated">毛利</div>
        </div>

        <div class="col">
          <h3 class="light" ng-show="saleAnalytics.loaded">{{saleAnalytics.totalMarginRatio+'%'}}</h3>
          <div class="attenuated">毛利率</div>
        </div>
      </div>
    </section>
    <section class="sell-chart">
      <ion-tabs class="tabs-striped tabs-top tabs-color-active-royal">

        <ion-tab title="按品牌">
          <div class="inner-content">
            <a class="item item-borderless margin-bottom item-icon-right" href="#/brand-sale">
              品牌销售前五({{"今日"}})
              <span class="item-note">明细</span>
              <i class="icon ion-ios-more-outline balanced"></i>
            </a>
            <canvas id="doughnut" class="chart chart-doughnut" chart-data="databrand" chart-labels="labelsbrand" chart-legend="true" height="180"></canvas> 
          </div>
        </ion-tab>

        <ion-tab title="按机型" on-select="initChart('model')">
          <div class="inner-content">
            <a class="item item-borderless margin-bottom item-icon-right" href="#/type-sale">
              单品销售前五({{"今日"}})
              <span class="item-note">明细</span>
              <i class="icon ion-ios-more-outline balanced"></i>
            </a>
            <canvas id="pie" class="chart chart-pie" chart-data="datamodel" chart-labels="labelsmodel" height="180"></canvas> 
          </div>
        </ion-tab>

        <ion-tab title="按门店" on-select="initChart('store')">
          <div class="inner-content">
            <a class="item item-borderless margin-bottom item-icon-right" href="#/store-sale">
              门店销售前五({{"今日"}})
              <span class="item-note">明细</span>
              <i class="icon ion-ios-more-outline balanced"></i>
            </a>
            <canvas id="polar-area" class="chart chart-polar-area" chart-data="datastore" chart-labels="labelsstore" chart-legend="true" height="180"></canvas> 
          </div>
        </ion-tab>

        <ion-tab title="按销售员" on-select="initChart('seller')">
          <div class="inner-content">
            <a class="item item-borderless margin-bottom item-icon-right" href="#/seller-sale">
              销售员业绩前五({{"今日"}})
              <span class="item-note">明细</span>
              <i class="icon ion-ios-more-outline balanced"></i>
            </a>
            <canvas id="pie" class="chart chart-pie" chart-data="dataseller" chart-labels="labelsseller" chart-legend="true" height="180"></canvas> 
          </div>
        </ion-tab>
      </ion-tabs>
    </section>
  <!-- 日期过滤器 -->
  <div ng-include="'templates/common/model/filters.html'"></div>
  </ion-content>

</ion-view>
